package com.hx.xiao.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hx.xiao.entity.Fan;
import com.hx.xiao.entity.Hou;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface FanMapper extends BaseMapper<Fan> {

    @Insert("insert into fan(uid,fankui) values (#{uid},#{fankui})")
    int addById(Fan fan);

    @Select("select uid,fankui from fan where uid=#{uid}")
    List<Fan> findAll(Integer uid);

    @Select("select id,uid,fankui from fan")
    List<Fan> findAllBy();

    @Select("select id,uid,fankui from fan where id=#{id}")
    Fan findByIdFan(Integer id);

    @Delete("delete from fan where id=#{id}")
    int deleteById(Integer id);

    @Update("update fan set fankui=#{fankui} where id=#{id}")
    int updateByIdii(Fan fan);
}
